package interrogation;

import static org.junit.Assert.*;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class ReplacementOfGetTitle {
	static WebDriver driver; 
	static String url = "http://www.compendiumdev.co.uk/selenium/find_by_playground.php";
	@BeforeClass
	public static void setUp(){
		driver = new FirefoxDriver();
		driver.get(url);
	}
	@AfterClass
	public static void closeDriver(){
		driver.quit();
	}

	@Test
	public void testByCSS() {
		
		WebElement title = driver.findElement(By.cssSelector("title"));
		assertEquals("Welcome to the Find By Playground",title.getText());
	}
	@Test
	public void testByXpath() {
		
		WebElement title = driver.findElement(By.xpath("//title"));
		assertEquals("Welcome to the Find By Playground",title.getText());
	}

}
